package com.layblog.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.layblog.entity.Post;
import com.baomidou.mybatisplus.extension.service.IService;
import com.layblog.vo.PostVO;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author JackLin
 * @since 2021-07-30
 */
public interface PostService extends IService<Post> {

    Post get(long id);

    boolean update(Post post);

    boolean delete(long id);

    void initIndexWeekRank();

    void zUnionAndStoreLast7DaysForLastWeekRank();

    void incrZsetValueAndUnionForLastWeekRank(Long postId, boolean isIncr);

    IPage paging(Page page, Long userId, Long categoryId, Integer level, Boolean recommend, String order);

    PostVO selectOne(QueryWrapper<Post> wrapper);

    void setViewCount(Post post);
}
